package com.okq.service.Impl;

import com.okq.dao.DictDao;
import com.okq.entity.Dict;
import com.okq.entity.Order;
import com.okq.service.IDictService;
import com.okq.util.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 描述 : 数据字典接口实现类
 * 作者 : zdl
 * 日期 : 2017/6/28 17:53
 */
@Transactional
@Service
public class DictServiceImpl implements IDictService {

    @Autowired
    private DictDao dictDao;

    @Override
    public void saveDict(Dict dict) {
        dictDao.saveDict(dict);
    }

    @Override
    public void deleteDict(Dict dict) {
        dictDao.deleteDict(dict);
    }

    @Override
    public void updateDict(Dict dict) {
        dictDao.updateDict(dict);
    }


    @Override
    public void saveOrUpdateDict(Dict dict) {
        dictDao.saveOrUpdateDict(dict);
    }

    @Override
    public Dict getDictById(String id) {
        return dictDao.getDictById(id);
    }

    @Override
    public List<Dict> listAllDict() {
        return dictDao.listAllDict();
    }

    @Override
    public Page<Dict> pageByDict(Page<Dict> page, Dict dict) {
        return dictDao.pageByDict(page, dict);
    }

    @Override
    public List<Dict> listDictByType(String type) {
        return dictDao.listDictByType(type);
    }

    @Override
    public String getDictByValueAndType(Integer value, String type) {
        return dictDao.getDictByValueAndType(value, type);
    }

	@Override
	public Order getOrderList() {
		// TODO Auto-generated method stub
		return null;
	}
}
